package com.mtsmda.chapter1.finalE;

public /*final*/ class BMW {

	private String model;
	private String year;

	public BMW() {

	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}
	
	public final void setBWM(final String model){
		if(model.isEmpty()){
//			model = "dffd";
		}
	}
	
	public final void setBWM(final BMW bmw){
		System.out.println(bmw.getModel());
		System.out.println(bmw.getYear());
		
		bmw.setModel("5 series");
		bmw.setYear("2010");
		
		System.out.println(bmw.getModel());
		System.out.println(bmw.getYear());
		System.out.println(this.getBWM());
	}
	
	private String getBWM(){
		return model == null ? "NON" : model;
	}

}

class BMW2 extends BMW{
	public BMW2() {
		super();
		super.setBWM("X6");
		
	}
	
	public String getBWM(){
		return "";
		
	}
}